package cn.csg.iotplatform.module.system.controller.admin;

import cn.csg.iotplatform.framework.common.pojo.CommonResult;
import cn.csg.iotplatform.module.system.enums.ErrorCodeConstants;
import cn.csg.iotplatform.module.system.service.DemoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;

@Tag(name = "管理后台 - Test")
@RestController
@RequestMapping("/device/test")
@Validated
public class DemoTestController {

    @Resource
    private DemoService demoService;

    @GetMapping("/get")
    @Operation(summary = "获取 test 信息")
    @PermitAll
    public CommonResult<Integer> get() {
        return CommonResult.error(ErrorCodeConstants.ERROR_CODE_NOT_EXISTS);
    }

    @GetMapping("/zhf-test")
    @Operation(summary = "钟宏飞的测试接口")
    @PermitAll
    public CommonResult<Object> zhfTest() {
        this.demoService.zhfTest();
        return CommonResult.success(true);
    }

}
